import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'home',
    component: () => import('@/view/HelloWorld.vue'),
  },
  {
    path: '/vite',
    name: 'vite',
    component: () => import('@/view/HelloVite.vue'),
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
  scrollBehavior() {
    return { top: 0 }
  },
})

router.beforeEach((to, from, next) => {
  next()
})

router.afterEach((to, from, failure) => {

})

export { router }
